<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML>
<html lang="zh">
<head>
    <title>new</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <link type="text/css" href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">
    <link type="text/css" href="editor/wangEditor.min.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="bootstrap-3.3.5-dist/html5shiv.min.js"></script>
      <script src="bootstrap-3.3.5-dist/respond.min.js"></script>
    <![endif]-->
    <link rel="shortcut icon" href="photos/favicon.ico"/>
    <link rel="bookmark" href="photos/favicon.ico"/>
</head>
    <body>
        <div class="container-fluid">
          <div class="row">
          
    		<%@include file="topnavtag.jsp" %>
    
            <div class="col-md-6 col-xs-12 col-md-offset-3">
                <h2 style="display:inline;">在此编辑您的内容</h2>
                <div style="margin-top:30px;"></div>
                <label>内 容</label>
                <div id="et"></div>
                
                <form id="sendcc" action="sendCardContent" method="post">
                    <label>主 题</label>
                    <input class="form-control" type="text" name="tt" style="width:100%;" placeholder="主 题">
                    <label>类 别</label>
                    <select name="forumTypeName" class="form-control" style="letter-spacing:1px;">
                        <option value="java">JAVA</option>
                        <option value="javaweb">JAVAWEB</option>
                        <option value="c#">C#</option>
                        <option value="other">OTHER</option>
                    </select>
                    
                    <input type="text" id="taContent" name="content" style="display:none">
                    
                    <a href="http://www.wangeditor.com/">(为什么我会看到这款富文本编辑器?)</a>
                    <button class="form-control" type="button" onclick="sendIt()">发帖</button>
                </form>
                <div style="margin-top:30px;"></div>
            </div>
          </div>
        </div>
    
    
    <script src="jquery/jquery-3.0.0.min.js"></script>
    <script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="editor/wangEditor.min.js"></script>
    <script type="text/javascript">
        getAEditor();
        
        
        function getAEditor(){
            var E = window.wangEditor
            var editor = new E('#et')
            // 菜单配置
            editor.customConfig.menus = [
                'head',  // 标题
                //'underline',  // 下划线
                'foreColor',  // 文字颜色
                //'link',  // 插入链接
                //插入链接 网页会在当前页面进行跳转
                'justify',  // 对齐方式
                //'emoticon',  // 表情
                'table',  // 表格
                'code',  // 插入代码
            ]
            editor.create();
            
            $("#et").keyup(function(){
                $("#taContent").attr("value",editor.txt.html());
            });
            
            $("#et").onblur(function(){
                $("#taContent").attr("value",editor.txt.html());
            });
            
        }
        function sendIt(){
            var va =  $("#taContent").val();
            //alert(va);
            $("#sendcc").submit();
        }
    </script>
    </body>
</html>
